import request from '@/utils/request'

export const findBrandsByPage = (pageNum, pageSize, brandName) => {
  return request({
    url: `/admin/product/brand/findPage/${pageNum}/${pageSize}`,
    params: {
      brandName: brandName,
    },
    method: 'get',
  })
}

export const updateBrand = brand => {
  return request({
    url: `/admin/product/brand/updateBrand`,
    data: brand,
    method: 'put',
  })
}

export const insertBrand = brand => {
  return request({
    url: `/admin/product/brand/insertBrand`,
    data: brand,
    method: 'post',
  })
}

export const deleteBrandById = id => {
  return request({
    url: `/admin/product/brand/deleteBrandById/${id}`,
    method: 'delete',
  })
}
